package cn.wolfcode.crm.domain;

import cn.wolfcode.crm.util.JsonResult;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

@Setter
@Getter
public class Department {
    private Long id;
    private String name;
    private String sn;

    public String getJson(){
        HashMap map = new HashMap();
        map.put("id", id);
        map.put("name", name);
        map.put("sn", sn);
        //不能直接将this放进去toJSONString，回无限递归死循环，用map封装一下即可
        return JSON.toJSONString(map);
    }

}